<?php
error_reporting(0);
include 'db-connection/conn.php';
include 'submitemail.php';

$Name = $_REQUEST["name"];
$Lname = $_REQUEST["lname"];
$Email = $_REQUEST["email"];
$Time = $_REQUEST["time"];
$Phno = $_REQUEST["phno"];

$mailTo = "dasprasenjit55@gmail.com";

/*SUBJECT & BODY OF THE EMAIL*/
$subject = ucfirst($Name)." has requested for contacting us";


$comment = "";
$comment .=" First Name: ".ucfirst($Name);
$comment .="\n";
$comment .="Lname: ".ucfirst($Lname);
$comment .="\n";
$comment .="Email Address: ".ucfirst($email);
$comment .="\n";
$comment .="Time : ".ucfirst($Time);
$comment .="\n";
$comment .="Phno : ".ucfirst($Phno);
$comment .="\n";

/*  ENDS */


$sqlParts = "INSERT INTO tbl_finance_data ( `name`, `lname`, `email`, `time`, `phno`, `is_ansered`)
VALUES ('".addslashes($Name)."','".addslashes($Lname)."','".addslashes($Email)."',
'".addslashes($Time)."','".addslashes($Phno)."','Y')";

$run = mysql_query($sqlParts);

if($run)
{
	GENERATE_SMTP_MAIL($mailTo,$email,$name,'','',$subject,$comment);
	header("Location:financing.php?msg=success");
}	
else
{
	header("Location:financing.php?msg=failure");
}
?>